import * as mutationsTypes from '@/store/mutations-types'

export default {
  //用户登录
  [mutationsTypes.USER_LOGIN](state, payload) {
    state.user = payload
  },
  [mutationsTypes.SET_MOVIE_INFO_DETAIL](state, payload) {
    state.movieDetailInfo = payload
  },
  [mutationsTypes.EXCHANGE_MOVIE_DETAIL_NAV_ACTIVE_INDEX](state, payload) {
    state.movieDetailNavActiveIndex = payload
  },
  [mutationsTypes.EXCHANGE_HOME_NAV_ACTIVE_INDEX](state, payload) {
    state.homeNavActiveIndex = payload
  },
  [mutationsTypes.EXCHANGE_CREATE_ORDER_STEP_INDEX](state, payload) {
    state.createOrderStepIndex = payload
  },
  //改变分钟
  [mutationsTypes.EXCHANGE_MINUTES](state, payload) {
    state.orderPayCountDownMinutes = payload
  },
  //改变分钟 每次减1
  [mutationsTypes.EXCHANGE_MINUTES_STEP](state, payload) {
    state.orderPayCountDownMinutes -= 1
  },
  //改变秒
  [mutationsTypes.EXCHANGE_SECONDS](state, payload) {
    state.orderPayCountDownSeconds = payload
  },
  //改变秒每次减少1
  [mutationsTypes.EXCHANGE_SECONDS_STEP](state, payload) {
    state.orderPayCountDownSeconds -= 1
  },
  [mutationsTypes.EXCHANGE_CINEMA_ID](state, payload) {
    state.cinemaId = payload
  },
  //改变影院点击去选座按钮后 要传给选座页面的 的数据
  [mutationsTypes.EXCHANGE_CHOOSE_SEAT_PAGE_DATA](state, payload) {
    state.chooseSeatPageData = payload
  },
  //改变订单信息
  [mutationsTypes.EXCHANGE_ORDER_INFO](state, payload) {
    state.orderInfo = payload
  },
  //改变订单编号
  [mutationsTypes.EXCHANGE_ORDER_NUM](state, payload) {
    state.orderNum = payload
  },
  //改变应付金额
  [mutationsTypes.EXCHANGE_ACTUAL_MONEY](state, payload) {
    state.actualMoney = payload
  },

  [mutationsTypes.EXCHANGE_MOVIE_ID](state, payload) {
    state.movieId = payload
  },

  [mutationsTypes.EXIT_LOGIN](state) {
    state.user.userId = 0
  },
}
